{% extends "base.html" %}
{% block css %}
<link rel="stylesheet" href="/static/css/admin.css" />
{% endblock %}
{% block nav %}
   <div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
      <div class="container">

        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </a>
        <a class="brand" href="/admin/">Googler Admin</a>
        <div class="nav-collapse">
          <ul class="nav">

            <li class="active"><a href="/admin/">Home</a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
{% endblock %}

{% block content %}

<form class="form-horizontal" method="POST" action="/admin/manage_organization_tags">
  <fieldset>
    <input type="hidden" value="add" name="action" />
    <legend>{{ organization.name }}</legend>
    <div class="control-group">
      <label for="input01" class="control-label">Name</label>
      <div class="controls">
        <input type="text" name="tag_name" id="input01" class="input-xlarge">
        <input type="hidden" name="org_key" value="{{organization.key}}" id="input01" class="input-xlarge">
        <p class="help-block">Enter a tag name</p>
      </div>
    </div>
    <div class="control-group">
      <label for="input01" class="control-label">Associate to playlist?</label>
      <div class="controls">
        <input type="checkbox" name="assoc_to_pl" value="True" id="input01" class="input-xlarge">
        <p class="help-block">curated videos with this tag get added to a playlist.</p>
      </div>
    </div>

    <div class="form-actions">
      <button class="btn btn-primary" type="submit">Save Tag</button>
    </div>
  </fieldset>
</form>


<h3>All Existing Tags</h3>
<table class="table">
  <tr>
    <th>Tag name</th>
    <th>Is assigned to live playlist</th>
    <th></th>
  </tr>
  {% for tag in tags %}
  <tr>
  <form class="form-horizontal" method="POST" action="/admin/manage_organization_tags">
    <input type="hidden" name="action" value="delete" />
    <input type="hidden" name="org_key" value="{{organization.key}}" />
    <td><input type="hidden" name="tag_name" value="{{tag.name}}">{{tag.name}}</td>
    <td>{{tag.associate_to_playlist}} ({{ tag.playlistid }})</td>
    <td><button class="btn btn-primary" type="submit">Delete</button></td>
  </form>
  </tr>
  {% endfor %}
</table>



{% endblock %}


